package com.example.bean;

import com.example.exception.TestNotFoundException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class AppWideExceptionHandler {


    @ExceptionHandler(TestNotFoundException.class)
    @ResponseBody
    public String handleTestNotFoundException(){
        System.out.println("=====================");
        return "error/duplicate";
    }
}
